package com.Servlet;

import java.io.IOException;
import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.contract.sql.getInfor;
import com.javabean.contract.javaBeanZhuce;

/**
 * Servlet implementation class getInforServlet
 */
@WebServlet("/getInforServlet")
public class getInforServlet extends HttpServlet {
	private static final long serialVersionUID = 1L;
       
    /**
     * @see HttpServlet#HttpServlet()
     */
    public getInforServlet() {
        super();
        // TODO Auto-generated constructor stub
    }

	/**
	 * @see HttpServlet#doGet(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		request.setCharacterEncoding("utf-8");
		getInfor se=new getInfor();
		javaBeanZhuce us=new javaBeanZhuce();
		String[] list=new String[9];
		String name=(String) request.getAttribute("name");
		String school=null;
		String qq=null;
		String wechat=null;
		String youbian=null;
		String mobilephone=null;
		String email=null;
		String unit=null;
		String adress=null;
		String hometel=null;
		String unittel=null;
		String position=null;
		 list= se.select(us);
		 name=list[1];
		 school=list[0];
		 qq=list[2];
		 wechat=list[3];
		 youbian=list[4];
		 mobilephone=list[5];
		 email=list[6];
		 unit=list[7];
		 adress=list[8];
		 hometel=list[9];
		 unittel=list[10];
		 position=list[11];
		 request.setAttribute("name", name);
		 request.setAttribute("school", school);
		 request.setAttribute("qq", qq);
		 request.setAttribute("wechat", wechat);
		 request.setAttribute("youbian", youbian);
		 request.setAttribute("mobilephone", mobilephone);
		 request.setAttribute("email", email);
		 request.setAttribute("unit", unit);
		 request.setAttribute("adress", adress);
		 request.setAttribute("hometel", hometel);
		 request.setAttribute("unittel", unittel);
		 request.setAttribute("position", position);
		  
		  request.getRequestDispatcher("/getInfor.jsp").forward(request, response);
				
	}

	/**
	 * @see HttpServlet#doPost(HttpServletRequest request, HttpServletResponse response)
	 */
	protected void doPost(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
		// TODO Auto-generated method stub
		doGet(request, response);
	}

}
